package paquete.ea;

import java.util.List;
//import javax.swing.DefaultListModel;
import org.springframework.social.twitter.api.*;
import org.springframework.social.twitter.api.impl.TwitterTemplate;

public class Lector {
    private Twitter twitter;

    public void actualizar() {
        String consumerKey = "BUb0lJE80kD5eM2C7xVdLw"; // The application's consumer key
        String consumerSecret = "0reVv7jE1vm516jYY2TZflS1qoY9u46s6J6bOnpnt4"; // The application's consumer secret
        String accessToken = "130226921-lqutkhawk49GvBDFHKfX6Tl8hPOaGFvZQyNaRLi5"; // The access token granted after OAuth authorization
        String accessTokenSecret = "c3hecX55SrHpg4JGCqub12EW0Abjf5of6kNqySU"; // The access token secret granted after OAuth authorization
        Twitter twitter = new TwitterTemplate(consumerKey, consumerSecret, accessToken, accessTokenSecret);
        
        //twitter.timelineOperations().updateStatus("Spring Social is awesome!");
        //modelo.clear();
        List<Tweet> tweets = twitter.timelineOperations().getUserTimeline();
        for (Tweet twp : tweets) {
            //modelo.addElement(twp.getText());
        }
    }

    public Lector(Twitter twitter) {
        this.twitter=twitter;
    }
}
